
let weiboEles = document.querySelectorAll(".weibo");
weiboEles.forEach(( item , key )=>{
    item.onmouseenter = function (){
        let x = this.offsetWidth ; 
        let y = this.offsetHeight ; 
        let divEle = document.createElement("div");
        divEle.style.position = "absolute" ;
        divEle.style.width = x + "px" ;
        divEle.style.height = x + "px" ;
        divEle.style.top = - x + "px" ; 
        if( key == 0 ){
            divEle.style.backgroundImage = "url(./images/weibo.jpg)" ;
        } else if ( key == 1 ){
            divEle.style.backgroundImage = "url(./images/weixin.jpg)" ;
        }
        divEle.style.backgroundSize = `${x}px ${x}px` ; 
        item.appendChild(divEle);
    }
    item.onmouseleave = function (){
        let divEle = this.querySelector("div");
        divEle.remove();
    }
});
